Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transition() mixin prevent redundant 'transition: none' and pass null #30391

Merged
merged 5 commits into from
Apr 1, 2020

Conversation

ysds
Copy link
Member

@ysds ysds commented Mar 14, 2020

This PR includes three points:

1. transition(null) and transition(none) output the following redundant CSS, but should be prevented.

@media (prefers-reduced-motion: reduce) {
  selector {
    transition: none;
  }
}

2. Fix the problem where libsass(node-sass) can't handle transition(null) well:

selector {
  @include transition(null);
}
// output
selector {
  transition:;
}

3. The transition mixin now show warning message when use none or null with multiple arguments.

Before: https://www.sassmeister.com/gist/b4d2d3ce8601116308e72df97a0d309a
After: https://www.sassmeister.com/gist/7ddae4ab995e0b41bbb93abe6eff616f

@ysds
Copy link
Member Author

ysds commented Mar 14, 2020

I found a problem, please don't review yet.

@ysds
Copy link
Member Author

ysds commented Mar 14, 2020

OK, ready for review.

@ysds ysds changed the title transition() mixin prevent redundant 'none' for prefers-reduced-motion transition() mixin prevent redundant 'transition: none' and pass null Mar 14, 2020
@XhmikosR
Copy link
Member

Any reason we don't land this in v5?

@XhmikosR XhmikosR merged commit 053d5d5 into master Apr 1, 2020
@XhmikosR XhmikosR deleted the master-ysds-transition-mixin branch April 1, 2020 06:42
MartijnCuppens added a commit that referenced this pull request Apr 6, 2020
transition() mixin prevent redundant 'transition: none' and pass `null`
XhmikosR pushed a commit that referenced this pull request Apr 7, 2020
transition() mixin prevent redundant 'transition: none' and pass `null`
XhmikosR pushed a commit that referenced this pull request Apr 10, 2020
transition() mixin prevent redundant 'transition: none' and pass `null`
XhmikosR pushed a commit that referenced this pull request Apr 13, 2020
transition() mixin prevent redundant 'transition: none' and pass `null`
olsza pushed a commit to olsza/bootstrap that referenced this pull request Oct 3, 2020
…l` (twbs#30391)

* Prevent redundant 'none' for prefers-reduced-motion

* Output warning when use 'none' or 'null' with multiple arguments

* Fix for libsass(node-sass)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants